import Vue from 'vue'
import App from './App2'
import router from './router/index2'
import store from './store';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/reset.css'
import less from 'less'
import axios from 'axios'
import SearchTree from 'vue-search-tree'


let instance = axios.create({
  baseURL: '',
  timeout: 1000,  // 超时，401
})
instance.defaults.timeout = 3000;
// 请求拦截器
axios.interceptors.request.use(req=>{
  // console.log(req);
  req.headers['user'] = store.state.userInfo.user_id
  req.headers['role'] = store.state.userInfo.role_id
  return req;
}, err=>{});

// 响应拦截器
axios.interceptors.response.use(res=>{
  // console.log(res);
  return res;
}, err=>{});

Vue.use(less)
Vue.use(ElementUI);
Vue.config.productionTip = false;
Vue.prototype.$axios= axios
Vue.use(SearchTree)

Vue.config.productionTip = false;



new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')



